package day7;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileRead2 {
    public static void main(String[] args) {
        FileInputStream fin = null;
        try {
            fin = new FileInputStream("D:\\Documents\\桌面\\rent-freely-master\\free-room\\README.txt");
            int len = 0;//读取的长度
            byte b[] = new byte[100];

            while ((len = fin.read(b)) != -1) {
               //System.out.print(Arrays.toString(b));
                String str=new String(b,0,len);
                System.out.println(str);
            }

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fin != null) {
                try {
                    fin.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
